package com.paranoidvulture.javaEngine.MainPackage;
import java.awt.Image;
public class Sprite 
{
	private Animation a;
	private float x;
	private float y;
	private float vx;	//velocity x
	private float vy;	//velocity y
	
	//CONSTRUCTOR
	public Sprite(Animation obj)
	{
		this.a = obj;
	}
	
	//Change position
	public void update(long timePassed)
	{
		x += vx * timePassed;
		y += vy * timePassed;
		a.update(timePassed);
	}
	
	//get x position
	public float getX()
	{
		return x;
	}
	
	//get y position
	public float getY()
	{
		return y;
	}
	
	public void setX(float x)
	{
		this.x = x;
	}
	
	//get y position
	public void setY(float y)
	{
		this.y = y;
	}
	
	//get sprite width
	public int getWidth()
	{
		return a.getImage().getWidth(null);
	}
	
	//get the sprite height
	public int getHeight()
	{
		return a.getImage().getHeight(null);
	}
	
	//get horizontal velocity
	public float getVelosityX()
	{
		return vx;
	}
	
	//get vertical velocity
	public float getVelosityY()
	{
		return vy;
	}
	
	//set horizontal velocity
	public void setVelocityX(float vx)
	{
		this.vx = vx;
	}
	
	//set vertical velocity
	public void setVelocityY(float vy)
	{
		this.vy = vy;
	}
	
	//get sprite or image
	public Image getImage()
	{
		return a.getImage();
	}
}
